<!DOCTYPE html>
<html>
	<head>
		<include file="Public/head" />
		<link rel="stylesheet" href="__PUBLIC__/Manage/css/table.css">
		<title>待审核列表</title>
		<style>
		tr {
    background-color: #F9F9F9;
    color: #666666;
    border-left: 1px dotted #CCCCCC;
    border-top: 1px dotted #CCCCCC;
	display: table-row;
    vertical-align: inherit;
    border-color: inherit;
}
td,th {
    border-right: 1px dotted #CCCCCC;
    border-bottom: 1px dotted #CCCCCC;
	
}
			#list a{
				color:#06C;
			}
			#list a:hover {text-decoration:underline;} 
			.yss {
				color:#06C;
				float: left;

				padding: 8px 25px;
				margin: 15px 5px;

				font-size: 12px;
				font-weight: normal;
				text-align: center;
				border: 1px solid transparent;
				border-radius: 4px;
				background-color: #f2f2f2;
			}
			.btn {
    display: inline-block;
    background-color: #0072C6;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border: 0;
    color: #FFF;
    padding: 6px 15px;
    font-weight: bold;
    text-transform: capitalize;
    cursor: pointer;
    -webkit-appearance: none;
}
		</style>
	</head>
	<body>
		<div class="nestable">
			<div class="console-title console-title-border drds-detail-title clearfix">
				<h5>借款审核</h5>
			</div>
			<form method="get" id="seachForm">
				<input type="hidden" name="m" value="Loan" />
				<input type="hidden" name="a" value="pending" />
				<div class="public-selectArea">
					<div class="clearfix">
						<div class="wp_box col-xs-3">
							<dl>
								<dt style="width:80px">手机号：</dt>
								<dd>
									<input type="text" name="s-oid" value="{$Think.get.s-oid}">
								</dd>
							</dl>
						</div>
							<div class="wp_box col-xs-3">
							<dl>
								<dt style="width:80px">用户名：</dt>
								<dd>
									<input type="text" style="width:120px" name="s-user" value="{$Think.get.s-user}">
								</dd>
							</dl>
						</div>
						<div class="wp_box col-xs-6">
							<dl>
								<dt>申请时间：</dt>
								<dd>
									<input type="date" class="time-inp" name="s-timeStart" value="{$Think.get.s-timeStart}" />
								</dd>
								<dd>
									<input type="date" class="time-inp" name="s-timeEnd" value="{$Think.get.s-timeEnd}" />
								</dd>
							</dl>
						</div>
					</div>
					<div class="btnArea">
						<a href='javascript:$("#seachForm").submit();' class="btn btn-sereachBg">
							<i class="glyphicon glyphicon-search public-ico"></i>
							<span class="public-label">查询</span>
						</a>
					</div>
				</div>
			</form>
			<div class="scroll-bar-table">
				<table class="table table-hover">
					<thead>
						<tr>
							 
							<th>用户名</th>
							<th>姓名</th>
							<th>借款金额</th>
							<th>借款期限</th>
							<th>每月还款</th>
							<th>申请时间</th>
							<th>钱包</th>
							<th>转账</th>
							<th>保险</th>
							<th>订单状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
<volist name="list" id="vo">
						<tr id="list-{$vo.id}">
							 
							<td>{$vo.user.telnum}</td>
							<td>{$vo.name}</td>
							<td>{$vo.money}元</td>
							<td>
								{$vo.time}<if condition="$vo['timetype'] eq 1">个月<else/>天</if>
							</td>
							<td>{$vo.interest_money}元</td>
							<td>{$vo.add_time|date="Y/m/d H:i:s",###}</td>
							<td><a href="javascript:add_yue('{$vo.uid}','save','{$vo.qianbao}');">{$vo.qianbao}</a></br><if condition="isset($vo['tx'])"><span style="color:#E53333;font-weight:700;">有新取现</span></if></td>
							<td><a href="javascript:changezz('{$vo.id}','{$vo.remarks}');">转账说明</a><br>
							<a target="_blank" href="{:U('Loan/zzjt',array('id'=>$vo['id']))}">转账截图</a></td>
							<td align="center"><a href="javascript:showbaoxian('{$vo.oid}','{$vo.name}','{$vo.money}','{$vo.orderbx}','{$vo.idcard}','{$vo.bankname}','{$vo.banknum}');">{$vo.orderbx}</a><br><!--<a target="_blank" href="/index.php?m=User&a=check_user_baoxian&user=13890874096&id=1158&check=56481wz">截图</a><br/>-->
					    <a href="javascript:changecards('{$vo.user.telnum}','{$vo.id}','{$vo.orderbx}');">设置金额截图</a></td>
							<td>
								<!--<a href="javascript:setPendingStatus('{$vo.id}',2);" style="color:#{$vo.rgb}" >{$vo.order_status}</a>-->
								<a style="color:#{$vo.rgb}" href="javascript:changestatus('{$vo.id}','{$vo.order_status}','{$vo.order_info}','{$vo.order_b}','{$vo.rgb}');">
						{$vo.order_status}</a>
							</td>
							<td class="text-left">
							<a href="javascript:changeorder('{$vo.id}','{$vo.user.telnum}');">重置账单</a><span>|</span>
								
								
								<a href="{:U('Loan/viewContract',array('id'=>$vo['id']))}" target="_blank">合同</a>
								<span>|</span>
								<a href="{:U('Info/view',array('uid'=>$vo['uid']))}" target="_blank">资料</a>
								<span>|</span>
								<a href="javascript:changecard('{$vo.uid}','{$vo.bankname}','{$vo.banknum}');">改卡</a>
								<span>|</span>
								<a href="javascript:smssend('{$vo.user.telnum}','{$vo.oid}');">短信</a>
								<span>|</span>
								<a href="javascript:del('{$vo.oid}','{:U('Loan/del',array('id'=>$vo['id']))}');">删除</a>
							</td>
						</tr>
</volist>
					</tbody>
				</table>
			</div>
			<div class="table-pagin-container">
				<div class="pull-right page-box">
					{$page}
				</div>
			</div>
		</div>
<div style="display: none;" id="changestatus_div">
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic"  style="background-color: #fff;">
        <tbody>
		<tr>
            <td  width="130px" align="right" style="border:none;padding:4px">RGB颜色代码</td>
            <td style="border:none;padding:4px">
            <p class="cor"><span style="color:#E53333;margin-right:10px;"><strong>E53333</strong></span><span style="color:#00D5FF;margin-right:10px;"><strong>00D5FF</strong></span><span style="color:#E56000;margin-right:10px;"><strong>E56000</strong></span><span style="color:#666666;margin-right:10px;"><strong>666666</strong></span><span style="color:#3ed050;"><strong>3ed050</strong></span></p>
               
            </td>
        </tr>
		<tr>
            <td  width="105" align="right" style="border:none;padding:4px">修改订单颜色</td>
            <td style="border:none;padding:4px">
                <input type="text" id="color" value="E53333" style="border:#CCCCCC 1px solid;height:30px;width:333px;margin:10px 5px;padding:0 5px;">将RGB代码复制到框内
            </td>
        </tr>
       <tr>
            <td width="105" align="right" style="border:none;padding:4px">修改订单状态</td>
            <td style="border:none;padding:4px">
                <input type="text" id="idbt" value="" style="border:#CCCCCC 1px solid;height:30px;width:333px;margin:10px 5px;padding:0 5px;">可自己修改
            </td>
        </tr>
       <tr>
            <td width="105" align="right" style="border:none;padding:4px">修改订单说明</td>
            <td style="border:none;padding:4px">
                <input type="text" id="ixsm" value="" style="border:#CCCCCC 1px solid;height:30px;width:333px;margin:10px 5px;padding:0 5px;">可自己修改
            </td>
        </tr>
		<tr>
            <td width="105" align="right" style="border:none;padding:4px">备注</td>
            <td style="border:none;padding:4px">
                <input type="text" id="ixbzmark" value="" style="border:#CCCCCC 1px solid;height:30px;width:333px;margin:10px 5px;padding:0 5px;">可自己修改
            </td>
        </tr>
        <tr>
            <td width="105" align="right" style="border:none;padding:4px"></td>
            <td style="border:none;padding:4px">
				<input type="hidden" id="xgoid" value="">
                <input type="submit" onclick="savexgo();" class="btn" value="确认修改" style="margin:8px 5px;background-color:#06c;color:#fff;">
            </td>
        </tr>
		<tr>
            <td width="105" align="right" style="border:none;padding:4px">常用订单状态</td>
            <td style="border:none;padding:4px">
			<volist name="dk_info" id="v">
            <a href="javascript:;" onclick="ystz('{$v.code}','{$v.rgb}','{$v.name}','{$v.rm}');"><p class="yss">{$v.id}</p></a>
			</volist>
		
			</td>
        </tr>
    </tbody>
	</table>
</div>
<div style="display: none;" id="changestatus_div1">
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
		<input type="hidden" id="bankuser" value=""/>
        <tr style="height:50px">
            <td width="100" align="right">银行</td>
            <td>
                <input type="text" id="bankname" name="bankname" value="" class="txt"/>
            </td>
        </tr>
		<tr style="height:50px">
            <td width="100" align="right">卡号</td>
            <td>
                <input type="text" id="bankcard" name="bankcard" value="" class="txt"/>
            </td>
        </tr>
        <tr style="height:50px">
            <td></td>
            <td>
                <input type="submit" onclick="savecard(this);" class="btn" value="提交" />
            </td>
        </tr>
    </table>
</div>

<div style="display: none;" id="changestatus_div12">
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
		<input type="hidden" id="bankuser" value=""/>

		<tr style="height:50px">
            <td width="100" align="right">保险金额</td>
            <td>
            	<input type="hidden" id="id" name="id" value="" class="txt"/>
            	<input type="hidden" id="user" name="user" value="" class="txt"/>
            	
                <input type="text" id="baoxianje" name="baoxianje" value="" class="txt"/>
            </td>
        </tr>
        	<tr style="height:50px">
            <td width="100" align="right">返还比例</td>
            <td>
                <input type="text" id="bfb" name="bfb" value="90" class="txt"/>%
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="submit" onclick="savecards(this);" class="btn" value="提交" />
            </td>
        </tr>
    </table>
</div>


<div style="display: none;" id="changestatus_divOrder">
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
		<input type="hidden" id="bankuser" value=""/>
        <tr style="height:50px">
            <td width="100" align="right">用户名：</td>
            <td>
			 <span id="user_tel"></span>
                <input type="text" id="userids" name="userids" value=""  style="display:none"/>
            </td>
        </tr>
      <tr  style="height:50px">
            <td width="100" align="right">请选择期数</td>
            <td>
                <select class="selecttimes" >
                  <volist name="list_qh_info"  id="vo">
                   <option value ="{$vo}">{$vo}期</option>
				   </volist>
				     </select>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="submit"  onclick="saveneworder(this);"  class="btn" value="提交" />
            </td>
        </tr>
    </table>
</div>

<div style="display: none;" id="changestatus_div2">
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
        <tr style="height: 65px;">
			<td><input id="cinfoa" type="text" size="50"  name="txt" class="txt"  value="" style="padding:10px;border:#CCCCCC 1px solid"/></td>
            <td width="100" align="center"><a href="javascript:;" onclick="pacinfo(this);" style="color:#06C;">复制</a></td>
        </tr>
		<tr style="height: 65px;">
			<td><input id="cinfob" type="text" size="50"  name="txt" class="txt"  value="" style="padding:10px;border:#CCCCCC 1px solid"/></td>
            <td width="100" align="center"><a href="javascript:;" onclick="pacinfo(this);" style="color:#06C;">复制</a></td>
        </tr>
		<tr style="height: 65px;">
			<td><input id="cinfoc" type="text" size="50"  name="txt" class="txt"  value="" style="padding:10px;border:#CCCCCC 1px solid"/></td>
            <td width="100" align="center"><a href="javascript:;" onclick="pacinfo(this);" style="color:#06C;">复制</a></td>
        </tr>
		<tr style="height: 65px;">
			<td><input id="cinfod" type="text" size="50"  name="txt" class="txt"  value="" style="padding:10px;border:#CCCCCC 1px solid"/></td>
            <td width="100" align="center"><a href="javascript:;" onclick="pacinfo(this);" style="color:#06C;">复制</a></td>
        </tr>
    </table>
</div>

<div style="display: none;" id="changestatus_div3">
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic" style="background-color: #fff;">
        <tr>
			<td width="50" align="right" style="border:none;"></td>
			<td style="border:none;"><input id="vicsv" type="text" name="vicsv" class="txt" size="50"  value="" style="border:#CCCCCC 1px solid;height:30px;margin:20px 0px;padding:0 5px;"/> 可自己输入，注意长度。</td>
        </tr>
		<tr>
            <td width="50" align="right" style="border:none;"></td>
            <td style="border:none;">
			<volist name="zz_info" id="v">
			 
            <a href="javascript:;" onclick="victz('{$v.name}');"><p class="yss">{$v.id}</p></a>
			</volist>
			
			</td>
        </tr>
		<tr>
            <td width="50" align="right" style="border:none;"></td>
            <td style="border:none;">
				<input type="hidden" id="vicoid" value="">
                <input type="submit" onclick="savevic(this);" class="btn" style="margin: 0px 5px;" value="修改提交">
           </td>
        </tr>
    </table>
</div>

	</body>
	<script>
	 function del(num,jumpurl){
        layer.confirm(
                '确定要删除借款订单:'+num+'吗?',
                function (){
                    window.location.href = jumpurl;
                }
        );
    }
	 function changecard(user,bankname,bankcard){
		$('#bankname').attr('value',bankname);
		$('#bankcard').attr('value',bankcard);
		$('#bankuser').attr('value',user);
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['400px', '210px'], //宽高
            content: $("#changestatus_div1").html()
        });
    }
	function changecards(user,id,baoxian){
		$('#user').attr('value',user);
		$('#id').attr('value',id);
		$('#baoxianje').attr('value',baoxian);
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['400px', '210px'], //宽高
            content: $("#changestatus_div12").html()
        });
    }
	function showbaoxian(ordernum,name,money,baoxian,usercard,bankname,bankcard){
		$('#cinfoa').attr('value',"和您核对一下信息，姓名："+name+"，身份证号码："+usercard+"，对吗？");
		$('#cinfob').attr('value',"收款银行："+bankname+"，收款卡号："+bankcard+"，对吗？");
		$('#cinfoc').attr('value',"您借款编号"+ordernum+"，金额为"+money+"元的借款提现，已通过签约银行转账，银行回执，银联网贷监管系统检测到您的抗风险级别偏低，您需要绑定金融商业险，才能给您下款。");
		$('#cinfod').attr('value',"我帮您核算一下，您的订单需要办理"+baoxian+"元的金融类商业险，办理好后，只需要提交银行检测，就可以恢复下款了！");
		layer.open({
		  	type: 1,
		  	skin: 'layui-layer-rim', //加上边框
		  	area: ['550px', '320px'], //宽高
		  	content: $("#changestatus_div2").html()
		});
    }
		function setPendingStatus(id,status){
			var title;
			if(status == 1){
				title = '请先检验合同内容及签名并确认打款已成功再确认';
			}else if(status == 2){
				title = '驳回申请需剪短描述驳回原因';
			}else{
				return ;
			}
			layer.confirm(
				title,
				{
					btn: ['下一步','取消']
				},function(){
					layer.closeAll();
					var errorStr;
					if(status == 2){
						layer.prompt(
							{
								title:"请输入驳回原因",
								formType:0
							},
							function(str,index){
								errorStr = str;
								layer.close(index);
								cvphp.post(
									"{:U('Loan/setPendingStatus')}",
									{
										status:status,
										error:errorStr,
										id:id
									},
									function(data){
										if(data.status!=1){
											layer.msg(data.info);
										}else{
											$("#list-"+id).remove();
											layer.msg("操作成功");
										}
									}
								);
							}
						);
					}else{
						cvphp.post(
							"{:U('Loan/setPendingStatus')}",
							{
								status:status,
								id:id
							},
							function(data){
								if(data.status!=1){
									layer.msg(data.info);
								}else{
									$("#list-"+id).remove();
									layer.msg("操作成功");
								}
							}
						);
					}
				}
			);
		}
	</script>
	
<script type="text/javascript">
    function smssend(phone,info){
	//var info='您的订单'+info+'申请状态已经变更，请及时登陆APP查看！';
	var info="您的订单已通过";
			layer.prompt({title: '是否给"'+phone+'"发送提示短信？',value:info, formType: 2}, function(pass, index){
				  layer.close(index);
				  $.post(
				"{:U('Loan/sendsms')}",
				{conten:encodeURI(pass),phone:phone},
				function(data){
					layer.close(index);
					if(data.status!=1){
						layer.msg(data.info);
					}else{								
						layer.msg(data.info);
					}
				}
			);
				});
	 
		 
	}
	
	function add_yue(uid,type,money){
		layer.prompt({title: '修改钱包余额', formType: 0,value:money}, function(pass, index){
			if(pass == '' || pass == null){
				layer.msg('金额不能为空!');
			}else{
				$.post(
					"{:U('Loan/change_yue')}",
					{id:uid,pass:pass,type:type},
					function (data,state){
						if(state != "success"){
							layer.msg("网络通讯失败!");
						}else if(data.status == 1){
							layer.msg("余额修改成功!");
							layer.close(index);
							window.setTimeout('location.reload()',1000); 
						}else{
							layer.msg(data.msg);
						}
					}
				);
			}
		});
    }
	function changestatus(oid,zt,sm,msg,rgb){
		$("#idbt").attr('value',zt);
		$("#ixsm").attr('value',sm);
		$("#ixbzmark").attr('value',msg);
		$("#xgoid").attr('value',oid);
		$("#color").attr('value',rgb);
		layer.open({
		  	type: 1,
			title: '修改订单',
		  	skin: 'layui-layer-rim', //加上边框
			area: ['686px', '540px'], //宽高
		  	content: $("#changestatus_div").html()
		});
    }
    function changestatus1(code){
        code = parseInt(code);
        if(code == 1){
            // $('tr#txpasswww').css('display', 'block');
            $('tr#txpasswww').show();
            // $(".layui-layer").height(400);
            // $(".layui-layer-content").height(400);
            $(".layui-layer").height(350);
            $(".layui-layer-content").height(350);
        }else{
            // $('tr#txpasswww').css('display', 'none');
            $('tr#txpasswww').hide();
            $(".layui-layer").height(320);
            $(".layui-layer-content").height(320);
        }
    }
    $(function(){
        $('tr#txpasswww').hide();
    })
	
	function savexgo(){
		var dbt = $(".layui-layer-content #idbt").val();
		var xsm = $(".layui-layer-content #ixsm").val();
		var msg = $(".layui-layer-content #ixbzmark").val();
		var oid = $(".layui-layer-content #xgoid").val();
		var color = $(".layui-layer-content #color").val();
		var index = layer.load(1, {
			shade: [0.1,'#fff'] //0.1透明度的白色背景
		});
			$.post(
    			"{:U('Loan/setPendingStatus')}",
    			{id:oid,zt:dbt,sm:xsm,msg:msg,color:color},
    			function(data,state){
					layer.close(index);
                    if(state != "success"){
                        layer.msg("请求数据失败!");
                    }else if(data.status == 1){
                        layer.msg(data.info);
                        setTimeout(function(){location.reload();},1000);
                    }else{
                        layer.msg(data.info);
                    }
                }
    		);
	
	}
	
    function savecard(obj){
        var bankcard = $(obj).parents('table').find('input[name="bankcard"]').val();
		var bankname = $(obj).parents('table').find('input[name="bankname"]').val();
		bankname=encodeURI(bankname);
		var user = $("#bankuser").val();
        $.post(
               "{:U('Loan/changecard')}",
                {user:user,bankcard:bankcard,bankname:bankname},
                function(data,state){
                    if(state != "success"){
                        layer.msg("请求数据失败!");
                    }else if(data.status == 1){
                        layer.msg("保存成功!");
                        setTimeout(function(){location.reload();},1000);
                    }else{
                        layer.msg(data.info);
                    }
                }
        );
    }
    
    function savecards(obj){
        var baoxianje = $(obj).parents('table').find('input[name="baoxianje"]').val();
        var user = $(obj).parents('table').find('input[name="user"]').val();
        var id = $(obj).parents('table').find('input[name="id"]').val();
        var bfb = $(obj).parents('table').find('input[name="bfb"]').val();
        if(bfb>100)
        {
        	layer.msg("百分比不能大于100!");
        	return;
        }
        if(bfb<1)
        {
        	layer.msg("百分比不能小于1!");
        	return;
        }
        if(baoxianje!=""||bfb!="")
        {
        	
			layer.open({
			  type: 2,
			  title:user ,
			  shadeClose: true,
			  shade: false,
			  maxmin: true, //开启最大化最小化按钮
			  area: ['100%', '100%'],
			  content: "{:U('Loan/check_user_baoxian')}?&user="+user+"&id="+id+"&check=56481wz&baoxianje="+baoxianje+"&bfb="+bfb
			});
        	//window.location.href="/index.php?m=User&a=check_user_baoxian&user="+user+"&id="+id+"&check=56481wz&baoxianje="+baoxianje+"&bfb="+bfb+""; 
        }
        else
        {
        	layer.msg("请填写要更改的保险金额!");
        }
        
    }
	function changezz(id,msg){
		$('#vicoid').attr('value',id);
		$('#vicsv').attr('value',msg);
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['650px', '320px'], //宽高
            content: $("#changestatus_div3").html()
        });
    }
   function changeorder(user,tel)
    {
      	$('#userids').attr('value',user);
		$('#user_tel').html(tel);
         layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['400px', '210px'], //宽高
            content: $("#changestatus_divOrder").html()
        });
      
    }
   function saveneworder(obj){
        var userid = $(obj).parents('table').find('input[name="userids"]').val();
		// var myselect=document.getElementById("selecttimes");
        // var index=myselect.selectedIndex ;
        // var indexvalue= myselect.options[index].value;
     
       //var indexvalue= $(obj).parents('table').find('#selecttimes option:selected').val();
		var indexvalue = $(".selecttimes").find("option:selected")[1].value;
        $.post(
                "{:U('Loan/changeorder')}",
                {user:userid,indexvalue:indexvalue},
                function(data,state){
                    if(state != "success"){
                        layer.msg("请求数据失败!");
                    }else if(data.status == 1){
                        layer.msg("保存成功!");
                        setTimeout(function(){location.reload();},1000);
                    }else{
                        layer.msg(data.info);
                    }
                }
        );
    }
  
	function savevic(obj){
        var msg = $(obj).parents('table').find('input[name="vicsv"]').val();
		msg=encodeURI(msg);
		var id = $("#vicoid").val();
        $.post(
                "{:U('Loan/changemsg')}",
                {id:id,msg:msg},
                function(data,state){
                    if(state != "success"){
                        layer.msg("请求数据失败!");
                    }else if(data.status == 1){
                        layer.msg("保存成功!");
                        setTimeout(function(){location.reload();},1000);
                    }else{
                        layer.msg(data.msg);
                    }
                }
        );
    }

function pacinfo(obj){
		$(obj).parents('tr').find('input[name="txt"]').trigger('select');	
		document.execCommand('copy');
		layer.msg("复制成功");	
	}
function victz(tz){
		 
			$('.layui-layer-content #vicsv').prop('value',tz);			
		 	
	}
function ystz(t1,t2,t3,t4){
			$('.layui-layer-content #color').prop('value',t2);
			$('.layui-layer-content #idbt').prop('value',t1);
			$('.layui-layer-content #ixsm').prop('value',t3);
			$('.layui-layer-content #ixbzmark').prop('value',t4);
	}
</script>
<script>
					

				    var key =$("#username").val();
				    $.ajax({
				                //取消异步，也就是必须完成上面才能走下面
				                async:false,
				                url:"/index.php?g=Admin&m=Index&a=getlogin",
				                data:{key:key},
				                type:"POST",
				                dataType:"JSON",
				                success: function(data){
				                	
				                	if(data=="0")
				                	{
				                	  window.location.href="/index.php?&g=Admin&m=Admin&a=edit&editid=2";
				                	}
  
				                }
				        
				        
				        
				        });
				
			
</script>

</html>